home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / flex-2.5 / flex-2 / flex-2.5.3 / flex.skl < prev    next >
Encoding:
Text File  |  1996-05-26  |  32.8 KB  |  1,532 lines

  1. /* A lexical scanner generated by flex */
  2.  
  3. /* Scanner skeleton version:
  4.  * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.89 96/05/25 21:02:21 vern Exp $
  5.  */
  6.  
  7. #define FLEX_SCANNER
  8. #define YY_FLEX_MAJOR_VERSION 2
  9. #define YY_FLEX_MINOR_VERSION 5
  10.  
  11. %-
  12. #include <stdio.h>
  13. %*
  14.  
  15.  
  16. /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
  17. #ifdef c_plusplus
  18. #ifndef __cplusplus
  19. #define __cplusplus
  20. #endif
  21. #endif
  22.  
  23.  
  24. #ifdef __cplusplus
  25.  
  26. #include <stdlib.h>
  27. %+
  28. class istream;
  29. %*
  30. #include <unistd.h>
  31.  
  32. /* Use prototypes in function declarations. */
  33. #define YY_USE_PROTOS
  34.  
  35. /* The "const" storage-class-modifier is valid. */
  36. #define YY_USE_CONST
  37.  
  38. #else    /* ! __cplusplus */
  39.  
  40. #if __STDC__
  41.  
  42. #define YY_USE_PROTOS
  43. #define YY_USE_CONST
  44.  
  45. #endif    /* __STDC__ */
  46. #endif    /* ! __cplusplus */
  47.  
  48. #ifdef __TURBOC__
  49.  #pragma warn -rch
  50.  #pragma warn -use
  51. #include <io.h>
  52. #include <stdlib.h>
  53. #define YY_USE_CONST
  54. #define YY_USE_PROTOS
  55. #endif
  56.  
  57. #ifdef YY_USE_CONST
  58. #define yyconst const
  59. #else
  60. #define yyconst
  61. #endif
  62.  
  63.  
  64. #ifdef YY_USE_PROTOS
  65. #define YY_PROTO(proto) proto
  66. #else
  67. #define YY_PROTO(proto) ()
  68. #endif
  69.  
  70. /* Returned upon end-of-file. */
  71. #define YY_NULL 0
  72.  
  73. /* Promotes a possibly negative, possibly signed char to an unsigned
  74.  * integer for use as an array index.  If the signed char is negative,
  75.  * we want to instead treat it as an 8-bit unsigned char, hence the
  76.  * double cast.
  77.  */
  78. #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
  79.  
  80. /* Enter a start condition.  This macro really ought to take a parameter,
  81.  * but we do it the disgusting crufty way forced on us by the ()-less
  82.  * definition of BEGIN.
  83.  */
  84. #define BEGIN yy_start = 1 + 2 *
  85.  
  86. /* Translate the current start state into a value that can be later handed
  87.  * to BEGIN to return to the state.  The YYSTATE alias is for lex
  88.  * compatibility.
  89.  */
  90. #define YY_START ((yy_start - 1) / 2)
  91. #define YYSTATE YY_START
  92.  
  93. /* Action number for EOF rule of a given start state. */
  94. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  95.  
  96. /* Special action meaning "start processing a new file". */
  97. #define YY_NEW_FILE yyrestart( yyin )
  98.  
  99. #define YY_END_OF_BUFFER_CHAR 0
  100.  
  101. /* Size of default input buffer. */
  102. #define YY_BUF_SIZE 16384
  103.  
  104. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  105.  
  106. extern int yyleng;
  107. %-
  108. extern FILE *yyin, *yyout;
  109. %*
  110.  
  111. #define EOB_ACT_CONTINUE_SCAN 0
  112. #define EOB_ACT_END_OF_FILE 1
  113. #define EOB_ACT_LAST_MATCH 2
  114.  
  115. /* The funky do-while in the following #define is used to turn the definition
  116.  * int a single C statement (which needs a semi-colon terminator).  This
  117.  * avoids problems with code like:
  118.  *
  119.  *     if ( condition_holds )
  120.  *        yyless( 5 );
  121.  *    else
  122.  *        do_something_else();
  123.  *
  124.  * Prior to using the do-while the compiler would get upset at the
  125.  * "else" because it interpreted the "if" statement as being all
  126.  * done when it reached the ';' after the yyless() call.
  127.  */
  128.  
  129. /* Return all but the first 'n' matched characters back to the input stream. */
  130.  
  131. #define yyless(n) \
  132.     do \
  133.         { \
  134.         /* Undo effects of setting up yytext. */ \
  135.         *yy_cp = yy_hold_char; \
  136.         YY_RESTORE_YY_MORE_OFFSET \
  137.         yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
  138.         YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  139.         } \
  140.     while ( 0 )
  141.  
  142. #define unput(c) yyunput( c, yytext_ptr )
  143.  
  144. /* The following is because we cannot portably get our hands on size_t
  145.  * (without autoconf's help, which isn't available because we want
  146.  * flex-generated scanners to compile on their own).
  147.  */
  148. typedef unsigned int yy_size_t;
  149.  
  150.  
  151. struct yy_buffer_state
  152.     {
  153. %-
  154.     FILE *yy_input_file;
  155. %+
  156.     istream* yy_input_file;
  157. %*
  158.  
  159.     char *yy_ch_buf;        /* input buffer */
  160.     char *yy_buf_pos;        /* current position in input buffer */
  161.  
  162.     /* Size of input buffer in bytes, not including room for EOB
  163.      * characters.
  164.      */
  165.     yy_size_t yy_buf_size;
  166.  
  167.     /* Number of characters read into yy_ch_buf, not including EOB
  168.      * characters.
  169.      */
  170.     int yy_n_chars;
  171.  
  172.     /* Whether we "own" the buffer - i.e., we know we created it,
  173.      * and can realloc() it to grow it, and should free() it to
  174.      * delete it.
  175.      */
  176.     int yy_is_our_buffer;
  177.  
  178.     /* Whether this is an "interactive" input source; if so, and
  179.      * if we're using stdio for input, then we want to use getc()
  180.      * instead of fread(), to make sure we stop fetching input after
  181.      * each newline.
  182.      */
  183.     int yy_is_interactive;
  184.  
  185.     /* Whether we're considered to be at the beginning of a line.
  186.      * If so, '^' rules will be active on the next match, otherwise
  187.      * not.
  188.      */
  189.     int yy_at_bol;
  190.  
  191.     /* Whether to try to fill the input buffer when we reach the
  192.      * end of it.
  193.      */
  194.     int yy_fill_buffer;
  195.  
  196.     int yy_buffer_status;
  197. #define YY_BUFFER_NEW 0
  198. #define YY_BUFFER_NORMAL 1
  199.     /* When an EOF's been seen but there's still some text to process
  200.      * then we mark the buffer as YY_EOF_PENDING, to indicate that we
  201.      * shouldn't try reading from the input source any more.  We might
  202.      * still have a bunch of tokens to match, though, because of
  203.      * possible backing-up.
  204.      *
  205.      * When we actually see the EOF, we change the status to "new"
  206.      * (via yyrestart()), so that the user can continue scanning by
  207.      * just pointing yyin at a new input file.
  208.      */
  209. #define YY_BUFFER_EOF_PENDING 2
  210.     };
  211.  
  212. %- Standard (non-C++) definition
  213. static YY_BUFFER_STATE yy_current_buffer = 0;
  214. %*
  215.  
  216. /* We provide macros for accessing buffer states in case in the
  217.  * future we want to put the buffer states in a more general
  218.  * "scanner state".
  219.  */
  220. #define YY_CURRENT_BUFFER yy_current_buffer
  221.  
  222.  
  223. %- Standard (non-C++) definition
  224. /* yy_hold_char holds the character lost when yytext is formed. */
  225. static char yy_hold_char;
  226.  
  227. static int yy_n_chars;        /* number of characters read into yy_ch_buf */
  228.  
  229.  
  230. int yyleng;
  231.  
  232. /* Points to current character in buffer. */
  233. static char *yy_c_buf_p = (char *) 0;
  234. static int yy_init = 1;        /* whether we need to initialize */
  235. static int yy_start = 0;    /* start state number */
  236.  
  237. /* Flag which is used to allow yywrap()'s to do buffer switches
  238.  * instead of setting up a fresh yyin.  A bit of a hack ...
  239.  */
  240. static int yy_did_buffer_switch_on_eof;
  241.  
  242. void yyrestart YY_PROTO(( FILE *input_file ));
  243.  
  244. void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
  245. void yy_load_buffer_state YY_PROTO(( void ));
  246. YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
  247. void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
  248. void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
  249. void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
  250. #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
  251.  
  252. YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
  253. YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *str ));
  254. YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
  255. %*
  256.  
  257. static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
  258. static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
  259. static void yy_flex_free YY_PROTO(( void * ));
  260.  
  261. #define yy_new_buffer yy_create_buffer
  262.  
  263. #define yy_set_interactive(is_interactive) \
  264.     { \
  265.     if ( ! yy_current_buffer ) \
  266.         yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
  267.     yy_current_buffer->yy_is_interactive = is_interactive; \
  268.     }
  269.  
  270. #define yy_set_bol(at_bol) \
  271.     { \
  272.     if ( ! yy_current_buffer ) \
  273.         yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
  274.     yy_current_buffer->yy_at_bol = at_bol; \
  275.     }
  276.  
  277. #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
  278.  
  279. %% yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here
  280.  
  281. %- Standard (non-C++) definition
  282. static yy_state_type yy_get_previous_state YY_PROTO(( void ));
  283. static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
  284. static int yy_get_next_buffer YY_PROTO(( void ));
  285. static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
  286. %*
  287.  
  288. /* Done after the current pattern has been matched and before the
  289.  * corresponding action - sets up yytext.
  290.  */
  291. #define YY_DO_BEFORE_ACTION \
  292.     yytext_ptr = yy_bp; \
  293. %% code to fiddle yytext and yyleng for yymore() goes here
  294.     yy_hold_char = *yy_cp; \
  295.     *yy_cp = '\0'; \
  296. %% code to copy yytext_ptr to yytext[] goes here, if %array
  297.     yy_c_buf_p = yy_cp;
  298.  
  299. %% data tables for the DFA and the user's section 1 definitions go here
  300.  
  301. /* Macros after this point can all be overridden by user definitions in
  302.  * section 1.
  303.  */
  304.  
  305. #ifndef YY_SKIP_YYWRAP
  306. #ifdef __cplusplus
  307. extern "C" int yywrap YY_PROTO(( void ));
  308. #else
  309. extern int yywrap YY_PROTO(( void ));
  310. #endif
  311. #endif
  312.  
  313. %-
  314. #ifndef YY_NO_UNPUT
  315. static void yyunput YY_PROTO(( int c, char *buf_ptr ));
  316. #endif
  317. %*
  318.  
  319. #ifndef yytext_ptr
  320. static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
  321. #endif
  322.  
  323. #ifdef YY_NEED_STRLEN
  324. static int yy_flex_strlen YY_PROTO(( yyconst char * ));
  325. #endif
  326.  
  327. #ifndef YY_NO_INPUT
  328. %- Standard (non-C++) definition
  329. #ifdef __cplusplus
  330. static int yyinput YY_PROTO(( void ));
  331. #else
  332. static int input YY_PROTO(( void ));
  333. #endif
  334. %*
  335. #endif
  336.  
  337. #if YY_STACK_USED
  338. static int yy_start_stack_ptr = 0;
  339. static int yy_start_stack_depth = 0;
  340. static int *yy_start_stack = 0;
  341. #ifndef YY_NO_PUSH_STATE
  342. static void yy_push_state YY_PROTO(( int new_state ));
  343. #endif
  344. #ifndef YY_NO_POP_STATE
  345. static void yy_pop_state YY_PROTO(( void ));
  346. #endif
  347. #ifndef YY_NO_TOP_STATE
  348. static int yy_top_state YY_PROTO(( void ));
  349. #endif
  350.  
  351. #else
  352. #define YY_NO_PUSH_STATE 1
  353. #define YY_NO_POP_STATE 1
  354. #define YY_NO_TOP_STATE 1
  355. #endif
  356.  
  357. #ifdef YY_MALLOC_DECL
  358. YY_MALLOC_DECL
  359. #else
  360. #if __STDC__
  361. #ifndef __cplusplus
  362. #include <stdlib.h>
  363. #endif
  364. #else
  365. /* Just try to get by without declaring the routines.  This will fail
  366.  * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
  367.  * or sizeof(void*) != sizeof(int).
  368.  */
  369. #endif
  370. #endif
  371.  
  372. /* Amount of stuff to slurp up with each read. */
  373. #ifndef YY_READ_BUF_SIZE
  374. #define YY_READ_BUF_SIZE 8192
  375. #endif
  376.  
  377. /* Copy whatever the last rule matched to the standard output. */
  378.  
  379. #ifndef ECHO
  380. %- Standard (non-C++) definition
  381. /* This used to be an fputs(), but since the string might contain NUL's,
  382.  * we now use fwrite().
  383.  */
  384. #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
  385. %+ C++ definition
  386. #define ECHO LexerOutput( yytext, yyleng )
  387. %*
  388. #endif
  389.  
  390. /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  391.  * is returned in "result".
  392.  */
  393. #ifndef YY_INPUT
  394. #define YY_INPUT(buf,result,max_size) \
  395. %% fread()/read() definition of YY_INPUT goes here unless we're doing C++
  396. %+ C++ definition
  397.     if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
  398.         YY_FATAL_ERROR( "input in flex scanner failed" );
  399. %*
  400. #endif
  401.  
  402. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  403.  * we don't want an extra ';' after the "return" because that will cause
  404.  * some compilers to complain about unreachable statements.
  405.  */
  406. #ifndef yyterminate
  407. #define yyterminate() return YY_NULL
  408. #endif
  409.  
  410. /* Number of entries by which start-condition stack grows. */
  411. #ifndef YY_START_STACK_INCR
  412. #define YY_START_STACK_INCR 25
  413. #endif
  414.  
  415. /* Report a fatal error. */
  416. #ifndef YY_FATAL_ERROR
  417. %-
  418. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
  419. %+
  420. #define YY_FATAL_ERROR(msg) LexerError( msg )
  421. %*
  422. #endif
  423.  
  424. /* Default declaration of generated scanner - a define so the user can
  425.  * easily add parameters.
  426.  */
  427. #ifndef YY_DECL
  428. %- Standard (non-C++) definition
  429. #define YY_DECL int yylex YY_PROTO(( void ))
  430. %+ C++ definition
  431. #define YY_DECL int yyFlexLexer::yylex()
  432. %*
  433. #endif
  434.  
  435. /* Code executed at the beginning of each rule, after yytext and yyleng
  436.  * have been set up.
  437.  */
  438. #ifndef YY_USER_ACTION
  439. #define YY_USER_ACTION
  440. #endif
  441.  
  442. /* Code executed at the end of each rule. */
  443. #ifndef YY_BREAK
  444. #define YY_BREAK break;
  445. #endif
  446.  
  447. %% YY_RULE_SETUP definition goes here
  448.  
  449. YY_DECL
  450.     {
  451.     register yy_state_type yy_current_state;
  452.     register char *yy_cp, *yy_bp;
  453.     register int yy_act;
  454.  
  455. %% user's declarations go here
  456.  
  457.     if ( yy_init )
  458.         {
  459.         yy_init = 0;
  460.  
  461. #ifdef YY_USER_INIT
  462.         YY_USER_INIT;
  463. #endif
  464.  
  465.         if ( ! yy_start )
  466.             yy_start = 1;    /* first start state */
  467.  
  468.         if ( ! yyin )
  469. %-
  470.             yyin = stdin;
  471. %+
  472.             yyin = &cin;
  473. %*
  474.  
  475.         if ( ! yyout )
  476. %-
  477.             yyout = stdout;
  478. %+
  479.             yyout = &cout;
  480. %*
  481.  
  482.         if ( ! yy_current_buffer )
  483.             yy_current_buffer =
  484.                 yy_create_buffer( yyin, YY_BUF_SIZE );
  485.  
  486.         yy_load_buffer_state();
  487.         }
  488.  
  489.     while ( 1 )        /* loops until end-of-file is reached */
  490.         {
  491. %% yymore()-related code goes here
  492.         yy_cp = yy_c_buf_p;
  493.  
  494.         /* Support of yytext. */
  495.         *yy_cp = yy_hold_char;
  496.  
  497.         /* yy_bp points to the position in yy_ch_buf of the start of
  498.          * the current run.
  499.          */
  500.         yy_bp = yy_cp;
  501.  
  502. %% code to set up and find next match goes here
  503.  
  504. yy_find_action:
  505. %% code to find the action number goes here
  506.  
  507.         YY_DO_BEFORE_ACTION;
  508.  
  509. %% code for yylineno update goes here
  510.  
  511. do_action:    /* This label is used only to access EOF actions. */
  512.  
  513. %% debug code goes here
  514.  
  515.         switch ( yy_act )
  516.     { /* beginning of action switch */
  517. %% actions go here
  518.  
  519.     case YY_END_OF_BUFFER:
  520.         {
  521.         /* Amount of text matched not including the EOB char. */
  522.         int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
  523.  
  524.         /* Undo the effects of YY_DO_BEFORE_ACTION. */
  525.         *yy_cp = yy_hold_char;
  526.         YY_RESTORE_YY_MORE_OFFSET
  527.  
  528.         if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
  529.             {
  530.             /* We're scanning a new file or input source.  It's
  531.              * possible that this happened because the user
  532.              * just pointed yyin at a new source and called
  533.              * yylex().  If so, then we have to assure
  534.              * consistency between yy_current_buffer and our
  535.              * globals.  Here is the right place to do so, because
  536.              * this is the first action (other than possibly a
  537.              * back-up) that will match for the new input source.
  538.              */
  539.             yy_n_chars = yy_current_buffer->yy_n_chars;
  540.             yy_current_buffer->yy_input_file = yyin;
  541.             yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
  542.             }
  543.  
  544.         /* Note that here we test for yy_c_buf_p "<=" to the position
  545.          * of the first EOB in the buffer, since yy_c_buf_p will
  546.          * already have been incremented past the NUL character
  547.          * (since all states make transitions on EOB to the
  548.          * end-of-buffer state).  Contrast this with the test
  549.          * in input().
  550.          */
  551.         if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  552.             { /* This was really a NUL. */
  553.             yy_state_type yy_next_state;
  554.  
  555.             yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
  556.  
  557.             yy_current_state = yy_get_previous_state();
  558.  
  559.             /* Okay, we're now positioned to make the NUL
  560.              * transition.  We couldn't have
  561.              * yy_get_previous_state() go ahead and do it
  562.              * for us because it doesn't know how to deal
  563.              * with the possibility of jamming (and we don't
  564.              * want to build jamming into it because then it
  565.              * will run more slowly).
  566.              */
  567.  
  568.             yy_next_state = yy_try_NUL_trans( yy_current_state );
  569.  
  570.             yy_bp = yytext_ptr + YY_MORE_ADJ;
  571.  
  572.             if ( yy_next_state )
  573.                 {
  574.                 /* Consume the NUL. */
  575.                 yy_cp = ++yy_c_buf_p;
  576.                 yy_current_state = yy_next_state;
  577.                 goto yy_match;
  578.                 }
  579.  
  580.             else
  581.                 {
  582. %% code to do back-up for compressed tables and set up yy_cp goes here
  583.                 goto yy_find_action;
  584.                 }
  585.             }
  586.  
  587.         else switch ( yy_get_next_buffer() )
  588.             {
  589.             case EOB_ACT_END_OF_FILE:
  590.                 {
  591.                 yy_did_buffer_switch_on_eof = 0;
  592.  
  593.                 if ( yywrap() )
  594.                     {
  595.                     /* Note: because we've taken care in
  596.                      * yy_get_next_buffer() to have set up
  597.                      * yytext, we can now set up
  598.                      * yy_c_buf_p so that if some total
  599.                      * hoser (like flex itself) wants to
  600.                      * call the scanner after we return the
  601.                      * YY_NULL, it'll still work - another
  602.                      * YY_NULL will get returned.
  603.                      */
  604.                     yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
  605.  
  606.                     yy_act = YY_STATE_EOF(YY_START);
  607.                     goto do_action;
  608.                     }
  609.  
  610.                 else
  611.                     {
  612.                     if ( ! yy_did_buffer_switch_on_eof )
  613.                         YY_NEW_FILE;
  614.                     }
  615.                 break;
  616.                 }
  617.  
  618.             case EOB_ACT_CONTINUE_SCAN:
  619.                 yy_c_buf_p =
  620.                     yytext_ptr + yy_amount_of_matched_text;
  621.  
  622.                 yy_current_state = yy_get_previous_state();
  623.  
  624.                 yy_cp = yy_c_buf_p;
  625.                 yy_bp = yytext_ptr + YY_MORE_ADJ;
  626.                 goto yy_match;
  627.  
  628.             case EOB_ACT_LAST_MATCH:
  629.                 yy_c_buf_p =
  630.                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
  631.  
  632.                 yy_current_state = yy_get_previous_state();
  633.  
  634.                 yy_cp = yy_c_buf_p;
  635.                 yy_bp = yytext_ptr + YY_MORE_ADJ;
  636.                 goto yy_find_action;
  637.             }
  638.         break;
  639.         }
  640.  
  641.     default:
  642.         YY_FATAL_ERROR(
  643.             "fatal flex scanner internal error--no action found" );
  644.     } /* end of action switch */
  645.         } /* end of scanning one token */
  646.     } /* end of yylex */
  647.  
  648. %+
  649. yyFlexLexer::yyFlexLexer( istream* arg_yyin, ostream* arg_yyout )
  650.     {
  651.     yyin = arg_yyin;
  652.     yyout = arg_yyout;
  653.     yy_c_buf_p = 0;
  654.     yy_init = 1;
  655.     yy_start = 0;
  656.     yy_flex_debug = 0;
  657.     yylineno = 1;    // this will only get updated if %option yylineno
  658.  
  659.     yy_did_buffer_switch_on_eof = 0;
  660.  
  661.     yy_looking_for_trail_begin = 0;
  662.     yy_more_flag = 0;
  663.     yy_more_len = 0;
  664.     yy_more_offset = yy_prev_more_offset = 0;
  665.  
  666.     yy_start_stack_ptr = yy_start_stack_depth = 0;
  667.     yy_start_stack = 0;
  668.  
  669.     yy_current_buffer = 0;
  670.  
  671. #ifdef YY_USES_REJECT
  672.     yy_state_buf = new yy_state_type[YY_BUF_SIZE + 2];
  673. #else
  674.     yy_state_buf = 0;
  675. #endif
  676.     }
  677.  
  678. yyFlexLexer::~yyFlexLexer()
  679.     {
  680.     delete yy_state_buf;
  681.     yy_delete_buffer( yy_current_buffer );
  682.     }
  683.  
  684. void yyFlexLexer::switch_streams( istream* new_in, ostream* new_out )
  685.     {
  686.     if ( new_in )
  687.         {
  688.         yy_delete_buffer( yy_current_buffer );
  689.         yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) );
  690.         }
  691.  
  692.     if ( new_out )
  693.         yyout = new_out;
  694.     }
  695.  
  696. #ifdef YY_INTERACTIVE
  697. int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
  698. #else
  699. int yyFlexLexer::LexerInput( char* buf, int max_size )
  700. #endif
  701.     {
  702.     if ( yyin->eof() || yyin->fail() )
  703.         return 0;
  704.  
  705. #ifdef YY_INTERACTIVE
  706.     yyin->get( buf[0] );
  707.  
  708.     if ( yyin->eof() )
  709.         return 0;
  710.  
  711.     if ( yyin->bad() )
  712.         return -1;
  713.  
  714.     return 1;
  715.  
  716. #else
  717.     (void) yyin->read( buf, max_size );
  718.  
  719.     if ( yyin->bad() )
  720.         return -1;
  721.     else
  722.         return yyin->gcount();
  723. #endif
  724.     }
  725.  
  726. void yyFlexLexer::LexerOutput( const char* buf, int size )
  727.     {
  728.     (void) yyout->write( buf, size );
  729.     }
  730. %*
  731.  
  732. /* yy_get_next_buffer - try to read in a new buffer
  733.  *
  734.  * Returns a code representing an action:
  735.  *    EOB_ACT_LAST_MATCH -
  736.  *    EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  737.  *    EOB_ACT_END_OF_FILE - end of file
  738.  */
  739.  
  740. %-
  741. static int yy_get_next_buffer()
  742. %+
  743. int yyFlexLexer::yy_get_next_buffer()
  744. %*
  745.     {
  746.     register char *dest = yy_current_buffer->yy_ch_buf;
  747.     register char *source = yytext_ptr;
  748.     register int number_to_move, i;
  749.     int ret_val;
  750.  
  751.     if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
  752.         YY_FATAL_ERROR(
  753.         "fatal flex scanner internal error--end of buffer missed" );
  754.  
  755.     if ( yy_current_buffer->yy_fill_buffer == 0 )
  756.         { /* Don't try to fill the buffer, so this is an EOF. */
  757.         if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
  758.             {
  759.             /* We matched a single character, the EOB, so
  760.              * treat this as a final EOF.
  761.              */
  762.             return EOB_ACT_END_OF_FILE;
  763.             }
  764.  
  765.         else
  766.             {
  767.             /* We matched some text prior to the EOB, first
  768.              * process it.
  769.              */
  770.             return EOB_ACT_LAST_MATCH;
  771.             }
  772.         }
  773.  
  774.     /* Try to read more data. */
  775.  
  776.     /* First move last chars to start of buffer. */
  777.     number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
  778.  
  779.     for ( i = 0; i < number_to_move; ++i )
  780.         *(dest++) = *(source++);
  781.  
  782.     if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  783.         /* don't do the read, it's not guaranteed to return an EOF,
  784.          * just force an EOF
  785.          */
  786.         yy_n_chars = 0;
  787.  
  788.     else
  789.         {
  790.         int num_to_read =
  791.             yy_current_buffer->yy_buf_size - number_to_move - 1;
  792.  
  793.         while ( num_to_read <= 0 )
  794.             { /* Not enough room in the buffer - grow it. */
  795. #ifdef YY_USES_REJECT
  796.             YY_FATAL_ERROR(
  797. "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
  798. #else
  799.  
  800.             /* just a shorter name for the current buffer */
  801.             YY_BUFFER_STATE b = yy_current_buffer;
  802.  
  803.             int yy_c_buf_p_offset =
  804.                 (int) (yy_c_buf_p - b->yy_ch_buf);
  805.  
  806.             if ( b->yy_is_our_buffer )
  807.                 {
  808.                 int new_size = b->yy_buf_size * 2;
  809.  
  810.                 if ( new_size <= 0 )
  811.                     b->yy_buf_size += b->yy_buf_size / 8;
  812.                 else
  813.                     b->yy_buf_size *= 2;
  814.  
  815.                 b->yy_ch_buf = (char *)
  816.                     /* Include room in for 2 EOB chars. */
  817.                     yy_flex_realloc( (void *) b->yy_ch_buf,
  818.                              b->yy_buf_size + 2 );
  819.                 }
  820.             else
  821.                 /* Can't grow it, we don't own it. */
  822.                 b->yy_ch_buf = 0;
  823.  
  824.             if ( ! b->yy_ch_buf )
  825.                 YY_FATAL_ERROR(
  826.                 "fatal error - scanner input buffer overflow" );
  827.  
  828.             yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
  829.  
  830.             num_to_read = yy_current_buffer->yy_buf_size -
  831.                         number_to_move - 1;
  832. #endif
  833.             }
  834.  
  835.         if ( num_to_read > YY_READ_BUF_SIZE )
  836.             num_to_read = YY_READ_BUF_SIZE;
  837.  
  838.         /* Read in more data. */
  839.         YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
  840.             yy_n_chars, num_to_read );
  841.         }
  842.  
  843.     if ( yy_n_chars == 0 )
  844.         {
  845.         if ( number_to_move == YY_MORE_ADJ )
  846.             {
  847.             ret_val = EOB_ACT_END_OF_FILE;
  848.             yyrestart( yyin );
  849.             }
  850.  
  851.         else
  852.             {
  853.             ret_val = EOB_ACT_LAST_MATCH;
  854.             yy_current_buffer->yy_buffer_status =
  855.                 YY_BUFFER_EOF_PENDING;
  856.             }
  857.         }
  858.  
  859.     else
  860.         ret_val = EOB_ACT_CONTINUE_SCAN;
  861.  
  862.     yy_n_chars += number_to_move;
  863.     yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  864.     yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  865.  
  866.     yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
  867.  
  868.     return ret_val;
  869.     }
  870.  
  871.  
  872. /* yy_get_previous_state - get the state just before the EOB char was reached */
  873.  
  874. %-
  875. static yy_state_type yy_get_previous_state()
  876. %+
  877. yy_state_type yyFlexLexer::yy_get_previous_state()
  878. %*
  879.     {
  880.     register yy_state_type yy_current_state;
  881.     register char *yy_cp;
  882.  
  883. %% code to get the start state into yy_current_state goes here
  884.  
  885.     for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
  886.         {
  887. %% code to find the next state goes here
  888.         }
  889.  
  890.     return yy_current_state;
  891.     }
  892.  
  893.  
  894. /* yy_try_NUL_trans - try to make a transition on the NUL character
  895.  *
  896.  * synopsis
  897.  *    next_state = yy_try_NUL_trans( current_state );
  898.  */
  899.  
  900. %-
  901. #ifdef YY_USE_PROTOS
  902. static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
  903. #else
  904. static yy_state_type yy_try_NUL_trans( yy_current_state )
  905. yy_state_type yy_current_state;
  906. #endif
  907. %+
  908. yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
  909. %*
  910.     {
  911.     register int yy_is_jam;
  912. %% code to find the next state, and perhaps do backing up, goes here
  913.  
  914.     return yy_is_jam ? 0 : yy_current_state;
  915.     }
  916.  
  917.  
  918. %-
  919. #ifndef YY_NO_UNPUT
  920. #ifdef YY_USE_PROTOS
  921. static void yyunput( int c, register char *yy_bp )
  922. #else
  923. static void yyunput( c, yy_bp )
  924. int c;
  925. register char *yy_bp;
  926. #endif
  927. %+
  928. void yyFlexLexer::yyunput( int c, register char* yy_bp )
  929. %*
  930.     {
  931.     register char *yy_cp = yy_c_buf_p;
  932.  
  933.     /* undo effects of setting up yytext */
  934.     *yy_cp = yy_hold_char;
  935.  
  936.     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  937.         { /* need to shift things up to make room */
  938.         /* +2 for EOB chars. */
  939.         register int number_to_move = yy_n_chars + 2;
  940.         register char *dest = &yy_current_buffer->yy_ch_buf[
  941.                     yy_current_buffer->yy_buf_size + 2];
  942.         register char *source =
  943.                 &yy_current_buffer->yy_ch_buf[number_to_move];
  944.  
  945.         while ( source > yy_current_buffer->yy_ch_buf )
  946.             *--dest = *--source;
  947.  
  948.         yy_cp += (int) (dest - source);
  949.         yy_bp += (int) (dest - source);
  950.         yy_n_chars = yy_current_buffer->yy_buf_size;
  951.  
  952.         if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  953.             YY_FATAL_ERROR( "flex scanner push-back overflow" );
  954.         }
  955.  
  956.     *--yy_cp = (char) c;
  957.  
  958. %% update yylineno here
  959.  
  960.     yytext_ptr = yy_bp;
  961.     yy_hold_char = *yy_cp;
  962.     yy_c_buf_p = yy_cp;
  963.     }
  964. %-
  965. #endif    /* ifndef YY_NO_UNPUT */
  966. %*
  967.  
  968.  
  969. %-
  970. #ifdef __cplusplus
  971. static int yyinput()
  972. #else
  973. static int input()
  974. #endif
  975. %+
  976. int yyFlexLexer::yyinput()
  977. %*
  978.     {
  979.     int c;
  980.  
  981.     *yy_c_buf_p = yy_hold_char;
  982.  
  983.     if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  984.         {
  985.         /* yy_c_buf_p now points to the character we want to return.
  986.          * If this occurs *before* the EOB characters, then it's a
  987.          * valid NUL; if not, then we've hit the end of the buffer.
  988.          */
  989.         if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  990.             /* This was really a NUL. */
  991.             *yy_c_buf_p = '\0';
  992.  
  993.         else
  994.             { /* need more input */
  995.             int offset = yy_c_buf_p - yytext_ptr;
  996.             ++yy_c_buf_p;
  997.  
  998.             switch ( yy_get_next_buffer() )
  999.                 {
  1000.                 case EOB_ACT_END_OF_FILE:
  1001.                     {
  1002.                     if ( yywrap() )
  1003.                         {
  1004.                         yy_c_buf_p = yytext_ptr + offset;
  1005.                         return EOF;
  1006.                         }
  1007.  
  1008.                     if ( ! yy_did_buffer_switch_on_eof )
  1009.                         YY_NEW_FILE;
  1010. #ifdef __cplusplus
  1011.                     return yyinput();
  1012. #else
  1013.                     return input();
  1014. #endif
  1015.                     }
  1016.  
  1017.                 case EOB_ACT_CONTINUE_SCAN:
  1018.                     yy_c_buf_p = yytext_ptr + offset;
  1019.                     break;
  1020.  
  1021.                 case EOB_ACT_LAST_MATCH:
  1022. #ifdef __cplusplus
  1023.                     YY_FATAL_ERROR(
  1024.                     "unexpected last match in yyinput()" );
  1025. #else
  1026.                     YY_FATAL_ERROR(
  1027.                     "unexpected last match in input()" );
  1028. #endif
  1029.                 }
  1030.             }
  1031.         }
  1032.  
  1033.     c = *(unsigned char *) yy_c_buf_p;    /* cast for 8-bit char's */
  1034.     *yy_c_buf_p = '\0';    /* preserve yytext */
  1035.     yy_hold_char = *++yy_c_buf_p;
  1036.  
  1037. %% update BOL and yylineno
  1038.  
  1039.     return c;
  1040.     }
  1041.  
  1042.  
  1043. %-
  1044. #ifdef YY_USE_PROTOS
  1045. void yyrestart( FILE *input_file )
  1046. #else
  1047. void yyrestart( input_file )
  1048. FILE *input_file;
  1049. #endif
  1050. %+
  1051. void yyFlexLexer::yyrestart( istream* input_file )
  1052. %*
  1053.     {
  1054.     if ( ! yy_current_buffer )
  1055.         yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
  1056.  
  1057.     yy_init_buffer( yy_current_buffer, input_file );
  1058.     yy_load_buffer_state();
  1059.     }
  1060.  
  1061.  
  1062. %-
  1063. #ifdef YY_USE_PROTOS
  1064. void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
  1065. #else
  1066. void yy_switch_to_buffer( new_buffer )
  1067. YY_BUFFER_STATE new_buffer;
  1068. #endif
  1069. %+
  1070. void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
  1071. %*
  1072.     {
  1073.     if ( yy_current_buffer == new_buffer )
  1074.         return;
  1075.  
  1076.     if ( yy_current_buffer )
  1077.         {
  1078.         /* Flush out information for old buffer. */
  1079.         *yy_c_buf_p = yy_hold_char;
  1080.         yy_current_buffer->yy_buf_pos = yy_c_buf_p;
  1081.         yy_current_buffer->yy_n_chars = yy_n_chars;
  1082.         }
  1083.  
  1084.     yy_current_buffer = new_buffer;
  1085.     yy_load_buffer_state();
  1086.  
  1087.     /* We don't actually know whether we did this switch during
  1088.      * EOF (yywrap()) processing, but the only time this flag
  1089.      * is looked at is after yywrap() is called, so it's safe
  1090.      * to go ahead and always set it.
  1091.      */
  1092.     yy_did_buffer_switch_on_eof = 1;
  1093.     }
  1094.  
  1095.  
  1096. %-
  1097. #ifdef YY_USE_PROTOS
  1098. void yy_load_buffer_state( void )
  1099. #else
  1100. void yy_load_buffer_state()
  1101. #endif
  1102. %+
  1103. void yyFlexLexer::yy_load_buffer_state()
  1104. %*
  1105.     {
  1106.     yy_n_chars = yy_current_buffer->yy_n_chars;
  1107.     yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
  1108.     yyin = yy_current_buffer->yy_input_file;
  1109.     yy_hold_char = *yy_c_buf_p;
  1110.     }
  1111.  
  1112.  
  1113. %-
  1114. #ifdef YY_USE_PROTOS
  1115. YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
  1116. #else
  1117. YY_BUFFER_STATE yy_create_buffer( file, size )
  1118. FILE *file;
  1119. int size;
  1120. #endif
  1121. %+
  1122. YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( istream* file, int size )
  1123. %*
  1124.     {
  1125.     YY_BUFFER_STATE b;
  1126.  
  1127.     b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
  1128.     if ( ! b )
  1129.         YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1130.  
  1131.     b->yy_buf_size = size;
  1132.  
  1133.     /* yy_ch_buf has to be 2 characters longer than the size given because
  1134.      * we need to put in 2 end-of-buffer characters.
  1135.      */
  1136.     b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
  1137.     if ( ! b->yy_ch_buf )
  1138.         YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1139.  
  1140.     b->yy_is_our_buffer = 1;
  1141.  
  1142.     yy_init_buffer( b, file );
  1143.  
  1144.     return b;
  1145.     }
  1146.  
  1147.  
  1148. %-
  1149. #ifdef YY_USE_PROTOS
  1150. void yy_delete_buffer( YY_BUFFER_STATE b )
  1151. #else
  1152. void yy_delete_buffer( b )
  1153. YY_BUFFER_STATE b;
  1154. #endif
  1155. %+
  1156. void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
  1157. %*
  1158.     {
  1159.     if ( ! b )
  1160.         return;
  1161.  
  1162.     if ( b == yy_current_buffer )
  1163.         yy_current_buffer = (YY_BUFFER_STATE) 0;
  1164.  
  1165.     if ( b->yy_is_our_buffer )
  1166.         yy_flex_free( (void *) b->yy_ch_buf );
  1167.  
  1168.     yy_flex_free( (void *) b );
  1169.     }
  1170.  
  1171.  
  1172. %-
  1173. #ifndef YY_ALWAYS_INTERACTIVE
  1174. #ifndef YY_NEVER_INTERACTIVE
  1175. extern int isatty YY_PROTO(( int ));
  1176. #endif
  1177. #endif
  1178.  
  1179. #ifdef YY_USE_PROTOS
  1180. void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
  1181. #else
  1182. void yy_init_buffer( b, file )
  1183. YY_BUFFER_STATE b;
  1184. FILE *file;
  1185. #endif
  1186.  
  1187. %+
  1188. extern "C" int isatty YY_PROTO(( int ));
  1189. void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, istream* file )
  1190. %*
  1191.  
  1192.     {
  1193.     yy_flush_buffer( b );
  1194.  
  1195.     b->yy_input_file = file;
  1196.     b->yy_fill_buffer = 1;
  1197.  
  1198. %-
  1199. #if YY_ALWAYS_INTERACTIVE
  1200.     b->yy_is_interactive = 1;
  1201. #else
  1202. #if YY_NEVER_INTERACTIVE
  1203.     b->yy_is_interactive = 0;
  1204. #else
  1205.     b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
  1206. #endif
  1207. #endif
  1208. %+
  1209.     b->yy_is_interactive = 0;
  1210. %*
  1211.     }
  1212.  
  1213.  
  1214. %-
  1215. #ifdef YY_USE_PROTOS
  1216. void yy_flush_buffer( YY_BUFFER_STATE b )
  1217. #else
  1218. void yy_flush_buffer( b )
  1219. YY_BUFFER_STATE b;
  1220. #endif
  1221.  
  1222. %+
  1223. void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )
  1224. %*
  1225.     {
  1226.     b->yy_n_chars = 0;
  1227.  
  1228.     /* We always need two end-of-buffer characters.  The first causes
  1229.      * a transition to the end-of-buffer state.  The second causes
  1230.      * a jam in that state.
  1231.      */
  1232.     b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  1233.     b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1234.  
  1235.     b->yy_buf_pos = &b->yy_ch_buf[0];
  1236.  
  1237.     b->yy_at_bol = 1;
  1238.     b->yy_buffer_status = YY_BUFFER_NEW;
  1239.  
  1240.     if ( b == yy_current_buffer )
  1241.         yy_load_buffer_state();
  1242.     }
  1243. %*
  1244.  
  1245.  
  1246. #ifndef YY_NO_SCAN_BUFFER
  1247. %-
  1248. #ifdef YY_USE_PROTOS
  1249. YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
  1250. #else
  1251. YY_BUFFER_STATE yy_scan_buffer( base, size )
  1252. char *base;
  1253. yy_size_t size;
  1254. #endif
  1255.     {
  1256.     YY_BUFFER_STATE b;
  1257.  
  1258.     if ( size < 2 ||
  1259.          base[size-2] != YY_END_OF_BUFFER_CHAR ||
  1260.          base[size-1] != YY_END_OF_BUFFER_CHAR )
  1261.         /* They forgot to leave room for the EOB's. */
  1262.         return 0;
  1263.  
  1264.     b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
  1265.     if ( ! b )
  1266.         YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
  1267.  
  1268.     b->yy_buf_size = size - 2;    /* "- 2" to take care of EOB's */
  1269.     b->yy_buf_pos = b->yy_ch_buf = base;
  1270.     b->yy_is_our_buffer = 0;
  1271.     b->yy_input_file = 0;
  1272.     b->yy_n_chars = b->yy_buf_size;
  1273.     b->yy_is_interactive = 0;
  1274.     b->yy_at_bol = 1;
  1275.     b->yy_fill_buffer = 0;
  1276.     b->yy_buffer_status = YY_BUFFER_NEW;
  1277.  
  1278.     yy_switch_to_buffer( b );
  1279.  
  1280.     return b;
  1281.     }
  1282. %*
  1283. #endif
  1284.  
  1285.  
  1286. #ifndef YY_NO_SCAN_STRING
  1287. %-
  1288. #ifdef YY_USE_PROTOS
  1289. YY_BUFFER_STATE yy_scan_string( yyconst char *str )
  1290. #else
  1291. YY_BUFFER_STATE yy_scan_string( str )
  1292. yyconst char *str;
  1293. #endif
  1294.     {
  1295.     int len;
  1296.     for ( len = 0; str[len]; ++len )
  1297.         ;
  1298.  
  1299.     return yy_scan_bytes( str, len );
  1300.     }
  1301. %*
  1302. #endif
  1303.  
  1304.  
  1305. #ifndef YY_NO_SCAN_BYTES
  1306. %-
  1307. #ifdef YY_USE_PROTOS
  1308. YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
  1309. #else
  1310. YY_BUFFER_STATE yy_scan_bytes( bytes, len )
  1311. yyconst char *bytes;
  1312. int len;
  1313. #endif
  1314.     {
  1315.     YY_BUFFER_STATE b;
  1316.     char *buf;
  1317.     yy_size_t n;
  1318.     int i;
  1319.  
  1320.     /* Get memory for full buffer, including space for trailing EOB's. */
  1321.     n = len + 2;
  1322.     buf = (char *) yy_flex_alloc( n );
  1323.     if ( ! buf )
  1324.         YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
  1325.  
  1326.     for ( i = 0; i < len; ++i )
  1327.         buf[i] = bytes[i];
  1328.  
  1329.     buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
  1330.  
  1331.     b = yy_scan_buffer( buf, n );
  1332.     if ( ! b )
  1333.         YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
  1334.  
  1335.     /* It's okay to grow etc. this buffer, and we should throw it
  1336.      * away when we're done.
  1337.      */
  1338.     b->yy_is_our_buffer = 1;
  1339.  
  1340.     return b;
  1341.     }
  1342. %*
  1343. #endif
  1344.  
  1345.  
  1346. #ifndef YY_NO_PUSH_STATE
  1347. %-
  1348. #ifdef YY_USE_PROTOS
  1349. static void yy_push_state( int new_state )
  1350. #else
  1351. static void yy_push_state( new_state )
  1352. int new_state;
  1353. #endif
  1354. %+
  1355. void yyFlexLexer::yy_push_state( int new_state )
  1356. %*
  1357.     {
  1358.     if ( yy_start_stack_ptr >= yy_start_stack_depth )
  1359.         {
  1360.         yy_size_t new_size;
  1361.  
  1362.         yy_start_stack_depth += YY_START_STACK_INCR;
  1363.         new_size = yy_start_stack_depth * sizeof( int );
  1364.  
  1365.         if ( ! yy_start_stack )
  1366.             yy_start_stack = (int *) yy_flex_alloc( new_size );
  1367.  
  1368.         else
  1369.             yy_start_stack = (int *) yy_flex_realloc(
  1370.                     (void *) yy_start_stack, new_size );
  1371.  
  1372.         if ( ! yy_start_stack )
  1373.             YY_FATAL_ERROR(
  1374.             "out of memory expanding start-condition stack" );
  1375.         }
  1376.  
  1377.     yy_start_stack[yy_start_stack_ptr++] = YY_START;
  1378.  
  1379.     BEGIN(new_state);
  1380.     }
  1381. #endif
  1382.  
  1383.  
  1384. #ifndef YY_NO_POP_STATE
  1385. %-
  1386. static void yy_pop_state()
  1387. %+
  1388. void yyFlexLexer::yy_pop_state()
  1389. %*
  1390.     {
  1391.     if ( --yy_start_stack_ptr < 0 )
  1392.         YY_FATAL_ERROR( "start-condition stack underflow" );
  1393.  
  1394.     BEGIN(yy_start_stack[yy_start_stack_ptr]);
  1395.     }
  1396. #endif
  1397.  
  1398.  
  1399. #ifndef YY_NO_TOP_STATE
  1400. %-
  1401. static int yy_top_state()
  1402. %+
  1403. int yyFlexLexer::yy_top_state()
  1404. %*
  1405.     {
  1406.     return yy_start_stack[yy_start_stack_ptr - 1];
  1407.     }
  1408. #endif
  1409.  
  1410. #ifndef YY_EXIT_FAILURE
  1411. #define YY_EXIT_FAILURE 2
  1412. #endif
  1413.  
  1414. %-
  1415. #ifdef YY_USE_PROTOS
  1416. static void yy_fatal_error( yyconst char msg[] )
  1417. #else
  1418. static void yy_fatal_error( msg )
  1419. char msg[];
  1420. #endif
  1421.     {
  1422.     (void) fprintf( stderr, "%s\n", msg );
  1423.     exit( YY_EXIT_FAILURE );
  1424.     }
  1425.  
  1426. %+
  1427.  
  1428. void yyFlexLexer::LexerError( yyconst char msg[] )
  1429.     {
  1430.     cerr << msg << '\n';
  1431.     exit( YY_EXIT_FAILURE );
  1432.     }
  1433. %*
  1434.  
  1435.  
  1436. /* Redefine yyless() so it works in section 3 code. */
  1437.  
  1438. #undef yyless
  1439. #define yyless(n) \
  1440.     do \
  1441.         { \
  1442.         /* Undo effects of setting up yytext. */ \
  1443.         yytext[yyleng] = yy_hold_char; \
  1444.         yy_c_buf_p = yytext + n; \
  1445.         yy_hold_char = *yy_c_buf_p; \
  1446.         *yy_c_buf_p = '\0'; \
  1447.         yyleng = n; \
  1448.         } \
  1449.     while ( 0 )
  1450.  
  1451.  
  1452. /* Internal utility routines. */
  1453.  
  1454. #ifndef yytext_ptr
  1455. #ifdef YY_USE_PROTOS
  1456. static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
  1457. #else
  1458. static void yy_flex_strncpy( s1, s2, n )
  1459. char *s1;
  1460. yyconst char *s2;
  1461. int n;
  1462. #endif
  1463.     {
  1464.     register int i;
  1465.     for ( i = 0; i < n; ++i )
  1466.         s1[i] = s2[i];
  1467.     }
  1468. #endif
  1469.  
  1470. #ifdef YY_NEED_STRLEN
  1471. #ifdef YY_USE_PROTOS
  1472. static int yy_flex_strlen( yyconst char *s )
  1473. #else
  1474. static int yy_flex_strlen( s )
  1475. yyconst char *s;
  1476. #endif
  1477.     {
  1478.     register int n;
  1479.     for ( n = 0; s[n]; ++n )
  1480.         ;
  1481.  
  1482.     return n;
  1483.     }
  1484. #endif
  1485.  
  1486.  
  1487. #ifdef YY_USE_PROTOS
  1488. static void *yy_flex_alloc( yy_size_t size )
  1489. #else
  1490. static void *yy_flex_alloc( size )
  1491. yy_size_t size;
  1492. #endif
  1493.     {
  1494.     return (void *) malloc( size );
  1495.     }
  1496.  
  1497. #ifdef YY_USE_PROTOS
  1498. static void *yy_flex_realloc( void *ptr, yy_size_t size )
  1499. #else
  1500. static void *yy_flex_realloc( ptr, size )
  1501. void *ptr;
  1502. yy_size_t size;
  1503. #endif
  1504.     {
  1505.     /* The cast to (char *) in the following accommodates both
  1506.      * implementations that use char* generic pointers, and those
  1507.      * that use void* generic pointers.  It works with the latter
  1508.      * because both ANSI C and C++ allow castless assignment from
  1509.      * any pointer type to void*, and deal with argument conversions
  1510.      * as though doing an assignment.
  1511.      */
  1512.     return (void *) realloc( (char *) ptr, size );
  1513.     }
  1514.  
  1515. #ifdef YY_USE_PROTOS
  1516. static void yy_flex_free( void *ptr )
  1517. #else
  1518. static void yy_flex_free( ptr )
  1519. void *ptr;
  1520. #endif
  1521.     {
  1522.     free( ptr );
  1523.     }
  1524.  
  1525. #if YY_MAIN
  1526. int main()
  1527.     {
  1528.     yylex();
  1529.     return 0;
  1530.     }
  1531. #endif
  1532.